﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;

namespace Nova_DAL
{
    public class LCDTask
    {
        int i = 0;
        string strSQL = "";
        DataSet ds = null;
        DbHelper dbHelper = new DbHelper();

        /// <summary>
        /// 查询所有的LCDTask 信息
        /// </summary>
        /// <returns></returns>
        public DataSet QueryALLLCDTaskInfor()
        {
            try
            {
                strSQL = @"select * from TLCDTask ";
                DbCommand cmd = dbHelper.GetSqlStringCommond(strSQL);
               
                ds = dbHelper.ExecuteDataSet(cmd);

            }
            catch
            {
                ds =null;
            }

            return ds;
        }

        /// <summary>
        /// 查询多少分钟内TLCDLog 信息
        /// </summary>
        /// <param name="minute">多少分钟内的</param>
        /// <returns></returns>
        public DataSet QueryLCDLogInfor(int minute)
        {
            try
            {
                strSQL = "select * from TLCDLog where datediff(minute,UpdateTime,getdate())<@minute";
                DbCommand cmd = dbHelper.GetSqlStringCommond(strSQL);
                dbHelper.AddInParameter(cmd, "@minute", DbType.Int32, minute);

                ds = dbHelper.ExecuteDataSet(cmd);

            }
            catch
            {
                ds = null;
            }

            return ds;
        }
    }
}
